package org.swiftsuspenders.injectionresults
{
	import org.swiftsuspenders.Injector;

	
public class InjectClassResult extends InjectionResult
{

	public function InjectClassResult(responseType : Class)
	{
		m_responseType = responseType;
	}
	
	
	private var m_responseType : Class;
	
	
	override public function getResponse(injector : Injector) : Object
	{
		return injector.instantiate(m_responseType);
	}

	override public function equals(otherResult : InjectionResult) : Boolean
	{
		if (otherResult == this)
		{
			return true;
		}
		if (!(otherResult is InjectClassResult))
		{
			return false;
		}
		var castedResult : InjectClassResult =  InjectClassResult(otherResult);
		return castedResult.m_responseType == m_responseType;
	}
}
}